<#include "head.html"/>
<SCRIPT type="text/javascript">
$(document).ready(function(){
	var ztree = $.fn.zTree.init($(document.getElementById("zTree_adminLIst")), setting, zNodes1);
	ztree.selectNode(ztree.getNodeByParam("id", "allwarn", null));
});
function submitSearchForm(currentPage){
	$("#p").val(currentPage);
	$("#searchForm").submit();
}
function controlDiv(id){
	if($("#but"+id).hasClass("a_close")){
		$("#"+id).slideUp(50);
		$("#but"+id).attr("class","tbControlIcon a_open");
	}else{
		$("#"+id).slideDown(50);
		$("#but"+id).attr("class","tbControlIcon a_close");
	}
}

function oncheck(value,obj){
	var type = "";
	if(obj.checked){
		 type="1";
	}else{
		 type="0";
	}
	loadURL("/${orgi}/manage/task/warn/searchsettingaddo.html?type="+type+"&value="+encodeURIComponent(value),"#tempdiv",
	function(data){});
}

</SCRIPT>
<div class="rs_layout_top breadCrumbWrap">
	<div class="breadCrumbStart">您当前的位置是：</div>
	<ul class="breadCrumb">
		<li class="bc_ithems"><a href="/${orgi}/manage/task/taskpassing.html">系统管理</a></li>
		<li class="bc_ithems"><a href="/${orgi}/manage/task/taskpassing.html">状态</a></li>
	</ul>
	<!-- <ul class="controlButtons">
		<li title="添加预警项" data-width="565" href="/${orgi}/manage/task/warn/warnsettingadd.html" id="newreport" data-toggle="ajax" class="cbtn-icon-32"></li>
	</ul> -->
</div>
<div class="rs_layout_left" resizable="true" style="width:230px;">
	<div class="lftTreeWrap">
		<div class="task_title2">状态</div>
		<div class="ztree" id="zTree_adminLIst"></div>
		<div class="rs_layout_top" style="font-size: 12px">
			<form id="searchForm" action="/${orgi}/manage/task/index.html" method="post"></form>
		</div>
	</div>
</div>
<!--<div class="rs_layout_right" style="width:300px;"></div>-->
<div class="rs_layout_center">
	<div class="rs_layout">
		<div class="rs_layout_center">
			<div class="tableScrollWrap">
				<table class="table_style_1">
					<thead>
						<tr>
							<th style="width:50px;text-align: right;">&nbsp;</th>
							<th>预警项</th>
							<th>预警描述</th>
							<th>阀值类型</th>
							<th>阀值</th>
							<th>预警级别</th>
							<th>预警方式</th>
							<th>操作</th>
						</tr>
					</thead>
					<#if datas ??>
				 		<#list datas as da>
						 	<tbody>
						 		<tr>
						 			<td class="minSize" style="border-bottom:1px solid #cccccc;">
										<a href="#" onclick="controlDiv('${da.id}')">
											<i id="but${da.id}" class="tbControlIcon a_close" style="height:16px;width:16px"></i>
										</a>
									</td>
									<td colspan="7" style="border-bottom:1px solid #cccccc;"><h4>${da.title!""}</h4></td>
						 		</tr>
					 		</tbody>
						 	<#if propertiesList??>
						 		<tbody id="${da.id}">
									<#list propertiesList as properties>
										<#assign templateSource = "${properties.groupid}"> 
										<#if da.name ?? && da.name = templateSource>
											<#assign template = "${properties.name}">
											<tr> 
												<td style="width:50px;text-align: right;" class="item">
								 					<input type="checkbox" name = "check" value="${properties.name!''}"  onclick="oncheck('${properties.name}',this)"
									 					<#if searchList??>
														<#list searchList as search>
														<#if search.sitename ?? && search.sitename = template>
									 						<#if search.spellcheck ?? && search.spellcheck =="1">checked="checked"</#if>
									 					</#if>
														</#list>
														</#if>
								 					/>
									 			</td>
												<td style="width:100px;">${properties.title!''}</td>
												<td style="width:340px;color: #CCCCCC" title="${properties.description!''}">
									 				<#if properties.description ?? && properties.description?length gt 25>
									 					${properties.description[0..25]}
									 				<#else>
										 				${properties.description!""}
									 				</#if>
									 			</td>
												<td style="width:140px;">
													<#if searchList??>
													<#list searchList as search>
													<#if search.sitename ?? && search.sitename = template>
														<#if search.hlsnippets?? && search.hlsnippets == "equal">等于</#if>
														<#if search.hlsnippets?? && search.hlsnippets == "scope">范围</#if>
														<#if search.hlsnippets?? && search.hlsnippets == "unequal">不等于</#if>
													</#if>
													</#list>
													</#if>
												</td>
												<td style="width:140px;">
													<#if searchList??>
													<#list searchList as search>
													<#if search.sitename ?? && search.sitename = template>
														<#if search.hlhtmlstart ?? && search.hlhtmlend ??>
															${search.hlhtmlstart}至${search.hlhtmlend}
														<#elseif search.hlhtmlstart !?? && search.hlhtmlend ??>
															${search.hlhtmlend}
														<#elseif search.hlhtmlstart ?? && search.hlhtmlend !??>
															${search.hlhtmlstart}
														</#if>
													</#if>
													</#list>
													</#if>
												</td>
												<td style="width:140px;">
													<#if searchList??>
													<#list searchList as search>
													<#if search.sitename ?? && search.sitename = template>
														<#if search.searchtype?? && search.searchtype == "endanger">危急</#if>
														<#if search.searchtype?? && search.searchtype == "urgent">紧急</#if>
														<#if search.searchtype?? && search.searchtype == "warn">警告</#if>
														<#if search.searchtype?? && search.searchtype == "prompt">提示</#if>
													</#if>
													</#list>
													</#if>
												</td>
												<td style="width:140px;">
													<#if searchList??>
													<#list searchList as search>
													<#if search.sitename ?? && search.sitename = template>
														<#if search.siteemail?? && search.siteemail == "eml">邮件</#if>
														<#if search.siteemail?? && search.siteemail == "sms">短信</#if>
														<!-- <#if search.siteemail?? && search.siteemail == "msg">内部消息</#if> -->
														<#if search.siteemail?? && search.siteemail == "eml,sms">邮件,短信</#if>
													</#if>
													</#list>
													</#if>
												</td>
												<td style="width:50px;">
									 				<a href="/${orgi}/manage/task/warn/searchsettingadd/${properties.name!''}.html" data-toggle="ajax" title="预警">
														<i class="tbControlIcon top_icon122"></i>
													</a>
												</td>
											</tr>
										 </#if>
									</#list>
								</tbody>
							</#if>
						</#list>
					 </#if>
				</table>
			</div>
		</div>
		<div class="rs_layout_bottom">
			<!-- <div class="papers_1">
				<a class="pageElems" href="javascript:void(0)" onclick="submitSearchForm(1);"><img title="首页" alt="首页" src="/assets/images/go-first-view.png"> </a>
				<a class="pageElems" href="javascript:void(0)" onclick="submitSearchForm(<#if (data.p<=0)>0<#else>${data.pages-1}</#if>);"><img title="上一页" alt="上一页" src="/assets/images/go-previous-view.png"></a>				
				<a class="pageElems" href="javascript:void(0)" onclick="submitSearchForm(<#if (data.p>=data.pages)>${data.pages}<#else>${data.p+1}</#if>);"><img title="下一页" alt="下一页" src="/assets/images/go-next-view.png"></a>
				<a class="pageElems" href="javascript:void(0)" onclick="submitSearchForm(${data.pages});"><img title="尾页" alt="尾页" src="/assets/images/go-last-view.png"></a>
			</div> -->
		</div>
	</div>
</div>
